import VueRouter from 'vue-router';
//当然如果需要有组件进来的时候也是需要引入的
import Home from './components/Home.vue';
import News from './components/News.vue';
import List from './components/List.vue';
import Detail from './pages/detail.vue';
import Create from './pages/Create.vue';
import Myhome from './pages/Myhome.vue';
import Personalhome from './pages/Personalhome.vue';
import Create721 from './pages/Create721.vue';
import Edit from './pages/Edit.vue';

//创建路由实例
let router = new VueRouter({
	routes: [
		{ path: '/', component: Home },
		{ path: '/home', component: Home },
		{ path: '/myhome', component: Myhome },
		{ path: '/personalhome', component: Personalhome },
		{ path: '/detail', component: Detail },
		{ path: '/create/erc721', component: Create721 },
		{ path: '/edit', component: Edit },
		{
			path: '/create',
			component: Create,
		},
		//path:路径 component:把你需要的组件挂载进来
		{
			path: '/news',
			component: News,
			//当你需要嵌套路由的时候你可以这么做
			//children子路由,接下来的json中的内容还是一样的,需要有最基本的path和component
			children: [{ path: '/list', component: List }],
		},
		// { path: '*', redirect: '/home' }, //404
		//当路径错误或没有这个路径的时候我们会给予一个默认路径
	],
});

export default router;
